package com.pig.controller.recipes;

import com.alibaba.dubbo.config.annotation.Reference;
import com.pig.pojo.recipes.Recipes;
import com.pig.service.recipes.RecipesService;
import com.pig.util.PageObject;
import com.pig.util.SysResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/recipes")
public class RecipesController {
    @Reference()
    private RecipesService recipesService;

    @RequestMapping("/doFindRecipes")
    public SysResult doFindRecipes(String username, Integer pageCurrent){
        System.out.println(pageCurrent);
        PageObject<Recipes> recipesPageObject = recipesService.findObject(username,pageCurrent);
        System.out.println(recipesPageObject);
        return SysResult.success(recipesPageObject);
    }
    @RequestMapping("/doFindRecipesById")
    public SysResult doFindObjectsById(Integer id){
        return SysResult.success(recipesService.findObjectById(id));
    }





}
